<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app"></div>
</body>
<script src="https://unpkg.com/vue@next"></script>
<script>
    const {ref}= Vue
    const app=Vue.createApp({
        template:`
        <div>
        <h1>我的信息</h1>
        <h2>姓名:{{name}}</h2>
        <h2>年龄:{{age}}</h2>    
        <button @click="changeInfo">修改信息</button>
        </div>`,
        setup(props) {
        let name=ref('andy');
        let age=ref(19);
        function changeInfo(){
            name.value='polk'
            age.value=23
        }
        return{name,age,changeInfo}
    }
    })
    app.mount("#app")
   
</script>
</html>